package kiwi.assist.dev.guieditor.command {
	import kiwi.assist.dev.guieditor.event.GUIEditorEvent;
	import kiwi.assist.dev.guieditor.view.BackgroundCanvasView;
	import kiwi.assist.dev.guieditor.view.CanvasView;
	import kiwi.assist.dev.guieditor.view.GuiEditorView;
	import kiwi.assist.dev.guieditor.view.SkinCanvasView;

	import org.robotlegs.mvcs.Command;

	/**
	 * 主界面初始化完毕了
	 * 这里为其他的command做好view的绑定工作
	 * @author zhangming.luo
	 */
	public class GuiEditorViewBindedCommand extends Command {
		[Inject]
		public var event : GUIEditorEvent;
		private var view : GuiEditorView;

		override public function execute() : void {
			super.execute();
			view = event.data;
			injector.mapValue(CanvasView, view.contentCanvas);
			injector.mapValue(BackgroundCanvasView, view.backgroundCanvas);
			injector.mapValue(SkinCanvasView, view.skinCanvas);
		}
	}
}

